
import request from './config';


export const getLogin=(params)=>{
    return request.post('/user/loginAdmin',params);
}

export const getRegister=(params)=>{
    return request.post('/user/register',params);
}

export const getUserList=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/mates/userinfo/all',{params});
}
export const getlinkList=(params)=>{
  for(let key in params){
      if(params[key]===''||params[key]===null){
          delete params[key]
      }
  }
  return request.get('/api/chat/getAll',{params});
}

export const deleChat=(params)=>{
  return request.post('/api/chat/delete',params);
}



// 用户
export const editUser=(params)=>{
    return request.post('/api/mates/userinfo/editbasic',params);
}
export const editMates=(params)=>{
    return request.post('/api/mates/userinfo/edit',params);
}
export const editUserPass=(params)=>{
    return request.post('/api/mates/userinfo/updatePass',params);
}

// 管理员

export const getAdminList=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/mates/admin/all',{params});
}

export const editAdmin=(params)=>{
    return request.post('/api/mates/admin/edit',params);
}

export const editAdminPass=(params)=>{
    return request.post('/api/mates/admin/updatePass',params);
}

export const addAdmin=(params)=>{
    return request.post('/api/mates/admin/add',params);
}

// 服务
export const getServer=()=>{
    return request.get('/api/server/getall');
}
export const editServer=(params)=>{
    return request.post('/api/server/edit',params);
}
export const deleServer=(params)=>{
    return request.post('/api/server/dele',params);
}
export const addServer=(params)=>{
    return request.post('/api/server/add',params);
}


//文件
export const getFile=(params)=>{
    return request.post('/api/file/getbyw',params);
}
export const deleFile=(params)=>{ //删除文件[id]
    return request.post('/api/file/del',params);
}
export const deleComFile=(params)=>{ //删除文件[id]
    return request.post('/api/file/delcom',params);
}


//广告
export const getBanner=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/public/banner/get',{params});
}

export const editBanner=(params)=>{
    return request.post('/api/public/banner/edit',params);
}
export const addBanner=(params)=>{
    return request.post('/api/public/banner/add',params);
}
export const deleBanner=(params)=>{
    return request.post('/api/public/banner/dele',params);
}

//文章
export const getArticleCate=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/article/cate/get',{params});
}

export const editArticleCate=(params)=>{
    return request.post('/api/article/cate/edit',params);
}
export const addArticleCate=(params)=>{
    return request.post('/api/article/cate/add',params);
}


//文章列表
export const getArticleList=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/article/ls/get',{params});
}

export const getArticlefont=(params)=>{
    return request.get('/api/article/ls/getfont',{params});
}

export const editArticleList=(params)=>{
    return request.post('/api/article/ls/edit',params);
}
export const addArticleList=(params)=>{
    return request.post('/api/article/ls/add',params);
}


export const getArticleReplay=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/article/art/getbyw',{params});
}

export const editArticleReplay=(params)=>{
    return request.post('/api/article/art/edit',params);
}

export const editAclReplay=(params)=>{
    return request.post('/api/article/art/acl/edit',params);
}
export const deleArticleReplay=(params)=>{
    return request.get('/api/article/art/dele',{params});
}
export const deleAclReplay=(params)=>{
    return request.get('/api/article/art/acl/dele',{params});
}

//资讯
export const getInformation=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/information/getbypage',{params});
}

export const getInformationfont=(params)=>{
    return request.get('/api/information/getfont',{params});
}

//添加
export const addInformation=(params)=>{
    return request.post('/api/information/info/add',params);
 }
export const editInformation=(params)=>{
    return request.post('/api/information/info/edit',params);
}

//获取班级
export const getClass=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/mates/class/get',{params});
}
export const addClass=(params)=>{
    return request.post('/api/mates/class/add',params);
}

export const editClass=(params)=>{
    return request.post('/api/mates/class/edit',params);
}

export const deleClass=(params)=>{
    return request.post('/api/mates/class/dele',params);
}
//课表
export const getCourse=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/mates/course/get',{params});
}
export const getCourseAll=(params)=>{
    return request.get('/api/mates/course/getall');
}

export const addCourse=(params)=>{
    return request.post('/api/mates/course/add',params);
}

export const editCourse=(params)=>{
    return request.post('/api/mates/course/edit',params);
}
export const deleCourse=(params)=>{
    return request.post('/api/mates/course/dele',params);
}

export const getSc=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.post('/api/mates/cs/get',params);
}
export const getScweek=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.post('/api/mates/cs/getcbweek',params);
}

export const addSc=(params)=>{
    return request.post('/api/mates/cs/add',params);
}

export const getSchoolDate=(params)=>{
    return request.get('/api/mates/cs/gettime');
}

export const editSc=(params)=>{
    return request.post('/api/mates/cs/edit',params);
}

export const deleSc=(params)=>{
    return request.post('/api/mates/cs/dele',params);
}
export const getTaskAll=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/task/getall',{params});
}

export const editTask=(params)=>{
    return request.post('/api/task/edit',params);
}
export const editOrder=(params)=>{
    return request.post('/api/task/order/edit',params);
}


export const getAccess=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/access/get',{params});
}
export const deleAccess=(params)=>{
    return request.get('/api/access/dele',{params});
}
export const editAccess=(params)=>{
    return request.post('/api/access/edit',params);
}

export const getTmepAll=(params)=>{
    for(let key in params){
        if(params[key]===''||params[key]===null){
            delete params[key]
        }
    }
    return request.get('/api/access/temp/getAll',{params});
}


